﻿using System;
using Microsoft.SPOT;
using Microsoft.SPOT.Presentation;
using Microsoft.SPOT.Presentation.Controls;
using Microsoft.SPOT.Presentation.Media;

using GT = Gadgeteer;
using GTM = Gadgeteer.Modules;

namespace BarometerTestApp
{
    public partial class Program
    {

        GTM.Seeed.Barometer barometer = new GTM.Seeed.Barometer(3);

        void ProgramStarted()
        {
            /******************************************************************************************
            Access modules defined in the designer by typing their name:                            
            
            e.g.  button
                  camera1

            Initialize event handlers here.
            e.g. button.ButtonPressed += new GTM.MSR.Button.ButtonEventHandler(button_ButtonPressed);             
            ***************************************************************************************** */

            barometer.MeasurementComplete += new GTM.Seeed.Barometer.MeasurementCompleteEventHandler(barometer_MeasurementComplete);
            barometer.StartContinuousMeasurements();

            // Do one-time tasks here
            Debug.Print("Program Started");
        }

        void barometer_MeasurementComplete(GTM.Seeed.Barometer sender, GTM.Seeed.Barometer.SensorData sensorData)
        {
            Debug.Print(sensorData.ToString());
        }
    }
}
